We need to lock the screen before suspending the system
to prevent unauthorized access to the system / account.
https://bugzilla.gnome.org/show_bug.cgi?id=643357
if (this._haveSuspend &&
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
- this._upClient.suspend_sync(null);
+ this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
+ this._upClient.suspend_sync(null);
+ }));
} else {
Util.spawn(['gnome-session-quit', '--power-off']);
}